<?php

namespace common\validate;

use think\Validate;

class TenantGroupMember extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Select 验证场景定义
    public function sceneSelect()
    {
        return $this->append('param', 'require|array')
            ->append('param.filter.tenant_group_id', 'require|integer')
            ->append('param.page', 'require');
    }

    // Add 验证场景定义
    public function sceneAdd()
    {
        return $this->append('data', 'require')
            ->append('data.tenant_id', 'require|integer')
            ->append('data.tenant_group_id', 'require|integer');
    }

    // Quit 验证场景定义
    public function sceneQuit()
    {
        return $this->append('data', 'require')
            ->append('data.tenant_group_id', 'require|integer');
    }

    public function sceneSelectTenantGroupMemberSupplier()
    {
        $this->append('param', 'require|array')
            ->append('param.filter', 'require|array');
    }

    public function sceneGetCurrentTenantGroup()
    {
        return $this->append('param', 'require|array')
            ->append('param.filter', 'array');
    }

    public function sceneGetTenantGroupMemberByProject()
    {
        return $this->append('param.filter.project_tenant_id', 'require|integer')
            ->append('param.filter.all_project_tenant_id', 'array');
    }

    // dissolve 验证场景定义
    public function sceneList()
    {
        return $this->append('param', 'require');
    }
}
